package wapchief.com.collectiondemo.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import wapchief.com.collectiondemo.greendao.model.Message;
import wapchief.com.collectiondemo.greendao.model.CarShop;
import wapchief.com.collectiondemo.greendao.model.User;

import wapchief.com.collectiondemo.greendao.MessageDao;
import wapchief.com.collectiondemo.greendao.CarShopDao;
import wapchief.com.collectiondemo.greendao.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig messageDaoConfig;
    private final DaoConfig carShopDaoConfig;
    private final DaoConfig userDaoConfig;

    private final MessageDao messageDao;
    private final CarShopDao carShopDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        messageDaoConfig = daoConfigMap.get(MessageDao.class).clone();
        messageDaoConfig.initIdentityScope(type);

        carShopDaoConfig = daoConfigMap.get(CarShopDao.class).clone();
        carShopDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        messageDao = new MessageDao(messageDaoConfig, this);
        carShopDao = new CarShopDao(carShopDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(Message.class, messageDao);
        registerDao(CarShop.class, carShopDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        messageDaoConfig.clearIdentityScope();
        carShopDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public MessageDao getMessageDao() {
        return messageDao;
    }

    public CarShopDao getCarShopDao() {
        return carShopDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
